package com.wits.qso.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import net.sf.json.JSONObject;

import com.wits.platform.entity.BaseEntity;

@Entity
@Table(name = "qso_btable_d")
public class BtableD extends BaseEntity
{
	private String id = null;
	private String btablehId = null;
	private String wDay = null;
	private String hourF = null;
	private String hourT = null;

	public BtableD() { super(); }

	@Id
	@GenericGenerator(name = "idGen", strategy = "com.wits.platform.common.id.generator.IDGenerator",
					  parameters = {
	        			@Parameter(name = "segment_value", value = "QSO_BTABLED_ID"), 
	        			@Parameter(name = "table_name", value = "wits_id_generator"),
	        			@Parameter(name = "value_column_name", value = "gen_value"), 
	        			@Parameter(name = "segment_column_name", value = "gen_name"),
	        			@Parameter(name = "segment_value_length", value = "10"), 
	        			@Parameter(name = "sq_format", value = "%08d"),
	        			@Parameter(name = "sq_prefix", value = "CR") })
	@GeneratedValue(generator = "idGen")
	@Column(name = "btabled_id", nullable = false, insertable = true, updatable = false, length = 10)
	public String getId() {
		return id;
	}

	@Column(name = "btableh_id", length = 10)
	public String getBtablehId() {
		return btablehId;
	}

	@Column(name="BTABLED_WDAY", length = 1)
	public String getwDay() {
		return wDay;
	}

	@Column(name="BTABLED_HOUR_F", length = 4)
	public String getHourF() {
		return hourF;
	}

	@Column(name="BTABLED_HOUR_T", length = 4)
	public String getHourT() {
		return hourT;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setBtablehId(String btablehId) {
		this.btablehId = btablehId;
	}

	public void setwDay(String wDay) {
		this.wDay = wDay;
	}

	public void setHourF(String hourF) {
		this.hourF = hourF;
	}

	public void setHourT(String hourT) {
		this.hourT = hourT;
	}

	@Override
	public String display() {
		return null;
	}

	@Override
	public String toString() {
		return JSONObject.fromObject( this, BtableD.getBaseJsonConfig() ).toString();
	}
}
